<%@ page import="cn.school.service.GradeService" %>
<%@ page import="cn.school.entity.Grade" %>
<%@ page import="java.util.List" %><%--
  Created by IntelliJ IDEA.
  User: oldliu
  Date: 2022-02-17
  Time: 16:09
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<form action="addSubjectServlet" method="post">
    <table border="1">
        <tr>
            <td>课程名</td>
            <td><input class="subjectname" type="text" name="subjectname"></td>
        </tr>
        <tr>
            <td>课时</td>
            <td><input class="classhour" type="number" name="classhour"></td>
        </tr>
        <tr>
            <td>年级号</td>
            <td>
                <select name="gradeid">
                   <%
                       List<Grade> all = GradeService.INST.findALL();
                       for(Grade g:all){
                   %>
                    <option value="<%=g.getId()%>"><%=g.getGname()%></option>
                    <%}%>
                </select>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <input type="submit" value="添加">
            </td>
        </tr>
    </table>
</form>
</body>
</html>
